<template>
    <div class="apply-container">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>授信申请单信息</span>
        </div>
        <my-form form-class="form-apply" :model="applyInfo" :form-items="formItems.basic" ref="formBasic" :label-width="labelWidth"></my-form>
      </el-card>
      <el-card class="box-card" style="margin-top: 20px">
        <div slot="header" class="clearfix">
          <span>授信资料清单</span>
        </div>
        <my-form form-class="form-apply" :model="applyInfo" :form-items="formItems.fileList" ref="formFile" :label-width="labelWidth"></my-form>
      </el-card>
      <div class="btn-container">
        <el-button type="primary" @click="submitApply">提交申请</el-button>
        <el-button type="info" @click="cancelApply">返回</el-button>
      </div>
    </div>
</template>

<script>
  const formItems = {
    basic:[{
      name: 'amount',
      label:'金额',
      type:'text',
      rule:{required: true, message: '请输入提款金额', trigger:'blur'}
    }
    ,{
      name: 'billingPeriod',
      label:'账期',
      type:'text',
      rule:{required: true, message: '请输入提款账期', trigger:'blur'}
    },{
      name: 'productId',
      label:'产品',
      type:'text',
      rule:{required: true, message: '请选择您的贷款产品', trigger:'blur'}
    },],
    fileList:[{
      name: 'attachment1',
      label:'贷款申请表',
      type:'singleFile',
      rule:{required: true, message: '请上传贷款申请表资料'}
    },{
      name: 'attachment2',
      label:'营业执照',
      type:'singleFile',
      rule:{required: true, message: '请上传营业执照照片'}
    },{
      name: 'attachment3',
      label:'身份证正面',
      type:'singleFile',
      rule:{required: true, message: '请上传身份证正面照片'}
    },{
      name: 'attachment4',
      label:'身份证反面',
      type:'singleFile',
      rule:{required: true, message: '请上传身份证反面照片'}
    },
//      贷款申请表
//      营业执照
//      身份证
//      结婚证
//      居住证明
//      验资报告、开户许可证、机构信用代码证和贷款卡
//      征信报告
//      公司章程
//      工商局调档-基本信息表
//      企业道路运输许可证等从业必要证照
//      实际控制人和公司高管简历
//      驾驶员信息清单
//      企业基本情况介绍
//      股东会决议
      {
        name: 'attachment4',
        label:'股东会决议',
        type:'singleFile',
        rule:{required: true, message: '请上传股东会决议资料'}
    }]};
  import * as selectDatas from '../../../constants/select-datas';
  import MyForm from '../../../components/MyForm';
    export default {
        name: 'CreditApply',
        components:{
          MyForm
        },
        data() {
            return {
              formItems: formItems,
              labelWidth: "180px",
              applyInfo:{}
          }
        },
        methods:{
          submitApply(){
          },
          cancelApply(){
            this.$emit('cancelApply')
          }
        }
    }
</script>

<style lang="stylus" scoped>
  .form-apply
    width 600px
  .btn-container
    margin-top: 15px
    padding-left: 200px
</style>
